-
-
Notifications
You must be signed in to change notification settings - Fork 146
Add basic link support to AppKit/macOS formatting bar #241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
I'm sorry for this taking so long. I've been waiting for WWDC'25 due to some rich text rumors, and sure enough - we now get a native approach for RichText in the native TextEditor. I will explore this a bit before making any decisions on this project. I think it may mean that this project will pivot away from the SwiftUI integrations, and instead focus on how to work with the attributed string in the best way. I'll leave this open until I know more. |
6afafbf
to
3081c72
Compare
The new native TextEditor doesn't support attachment, which lack of lots of feature for Rich text editing, so this project is pretty awesome for now and future in years. |
@younky-yang It doesn't? Even if you add the attachment to the attributed string, it doesn't render? |
At least for my current test, it doesn't support any attachment. The most easy approach to test it is to copy an image to the editor and nothing copied. But this works pretty well with UIKit stuff. |
Interesting, thank you for sharing! I think this leaves this library in a strange space, since the coordinator layer is what I would love to get rid of, and is what makes the library a bit too complicated to manage. It would have been amazing if the native text editor would have received full attributed string rendering capabilities, after which we could have changed this library to just extend the attributed string type, but I guess we need it still then. |
@itsthisjustin I'm afraid WWDC and the summer has thrown too much on my place, but I will aim to get to this PR eventually. |
This PR adds initial support for hyperlinking in the formatting bar on macOS (AppKit only for now).
What’s included:
• A link button was added to the existing toggle group in the formatting bar.
• CMD+K keyboard shortcut is now hooked up to trigger the link action.
• Clicking the button opens a sheet if the selected text does not already contain a link, allowing users to insert a URL.
• If the selected text already contains a link, the toggle is highlighted and clicking it will remove the link.
What’s not included:
• No support yet for internal links (could be added later).
• No ability to insert a link without selecting text first.
Open to suggestions for a better UI placement or UX improvements for the link feature.